<? $this->headTitle('Groups'); ?>
<? $this->placeholder('title')->set('Groups'); ?>

<p>
    <a href="<?php echo $this->url(array('controller'=>'groups', 'action'=>'add')); ?>">Add New Group</a>
</p>

<table class="t1">
    <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Users</th>
        <th>&nbsp;</th>
    </tr>
    <?php foreach($this->groups as $group): ?>
    <tr>
        <td><?php echo $this->escape($group->name); ?></td>
        <td><?php echo $this->escape($group->description); ?></td>
        <td>
            <?php foreach($group->users as $user) echo $user->name.'<br/>'; ?>
        </td>
        <td>
            <a href="<?php echo $this->url(array('controller'=>'groups', 'action'=>'edit', 'id'=>$group->id)); ?>">Edit</a>
            <a href="<?php echo $this->url(array('controller'=>'groups', 'action'=>'delete', 'id'=>$group->id)); ?>">Delete</a>
        </td>
    </tr>
    <?php endforeach; ?>
</table>